home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / basictut.arc / GUESS_1.BAS < prev    next >
BASIC Source File  |  1989-01-07  |  640b  |  11 lines

  1. 10 NUMBER=INT(RND*1000)+1       'pick a random integer between 1 and 1000
  2. 20 PRINT "I know a number between 1 and 1000, try and guess what it is."
  3. 30 INPUT "What is you guess";GUESS
  4. 40 COUNT=COUNT+1                'keep track of the number of guesses
  5. 50 IF NUMBER=GUESS THEN 80      'got it!
  6. 60 IF GUESS<NUMBER THEN PRINT "Too low,"; ELSE PRINT "Too high,";
  7. 70 PRINT " try again ... ";:GOTO 30
  8. 80 PRINT "You got it in";COUNT;"guesses!  Would you like to play again (Y/N)";
  9. 90 INPUT AGAIN$:IF AGAIN$="Y" OR AGAIN$="y" THEN 10
  10. NT "You got it in";COUNT;"guesses!  Would you like to play again (Y/N)";
  11. 90 INPUT AGAIN$:IF AGAIN$="Y" O